home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 22
/
Amiga Format AFCD22 (Jan 1998, Issue 106).iso
/
-readerstuff-
/
d_keletsekis
/
tools
/
fastread
/
helpdemo.gc
< prev
next >
Wrap
Text File
|
1997-10-03
|
2KB
|
90 lines
G4C
winbig -1 -1 300 153 "HelpDemo.gc"
winType 11110001
usetopaz
; ---- Message
ctext 20 8 "Switch Help ON and click a button" topaz.font 8 2 0 000
ctext 20 18 "to view the named section of the" topaz.font 8 2 0 000
ctext 20 28 "HelpSystem.txt doc file." topaz.font 8 2 0 000
ctext 20 48 "If Help is OFF, a requester will" topaz.font 8 2 0 000
ctext 20 58 "simulate the usual function of" topaz.font 8 2 0 000
ctext 20 68 "the button." topaz.font 8 2 0 000
box 0 0 0 0 out ridge
xonLoad
extract helpdemo.gc guipath fre_path
assign GCHELP: $fre_path
delvar fre_path
guiload gchelp:ViewText.g ; Load the reader, but don't open it.
helpon = 0 ; Set help mode OFF
guiopen helpdemo.gc
; ----- The target document is named here ----
docname = GUIS:Docs/User/HelpSystem.txt
xonClose
gosub HelpDemo.gc exit
; ---- An On/Off 'Help' CheckBox ----
XCHECKBOX 249 80 26 11 Help helpon 1 0 OFF
; The checkbox above is for switching online help on or off. When help
; is ON, the buttons below will stop functioning normally and instead
; fetch the required text from the HelpSystem.txt file.
; ---- The buttons for this demo script ----
XBUTTON 25 97 250 12 "Read the Help for FastRead.gc"
offset = "8655 1826"
gosub HelpDemo.gc open
; ** Then the buttons true function goes here... **
ezreq "This would be the gadget's\nnormal function." "Ah! I See!" ""
XBUTTON 25 115 250 12 "Read the Help for ViewText.g"
offset = "10513 1595"
gosub HelpDemo.gc open
; ** Then the buttons true function goes here... **
ezreq "This would be the gadget's\nnormal function." "Ah! I See!" ""
; -------------- The button for the HelpDemo patch -------------------
XBUTTON 25 133 250 12 "Read the Help for HelpDemo.gc"
offset = "12141 3952"
gosub HelpDemo.gc open
; ** Then the buttons true function goes here... **
ezreq "This would be the gadget's\nnormal function." "Ah! I See!" ""
; ------------------------ Subroutines -------------------------------
xroutine exit
assign GCHELP: remove
ifexists file ram:guide.txt
delete ram:guide.txt
endif
guiquit viewtext.g
guiquit helpdemo.gc
; ---------- This is the routine for opening the reader gui...
xroutine open
if $helpon = 0
return
elseif $helpon = 1
cli 'GUIS:C/WriteNode $docname $offset'
guiopen viewtext.g
guiwindow viewtext.g front
lvuse viewtext.g 1
lvchange ram:guide.txt
stop
endif